<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>BUG 管理系统-网站版</title>
    <link rel="stylesheet" href="/static/index/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/index.css">
</head>

<body style="background-color: #F0F0F0;">
<ul class="layui-nav">
    <li class="layui-nav-item">
        <a style="font-size: 18px;font-weight: 600;" href="#">BUG 管理系统-网站版</a>
    </li>
<!--    <li class="layui-nav-item">-->
<!--        <a href="http://www.linglukeji.com"  target="_blank">公司官网<span class="layui-badge-dot"></span></a>-->
<!--    </li>-->

    <li class="layui-nav-item">
        <a href="member.html">修改用户</a>
    </li>
    <li class="layui-nav-item">
        <a href="javascript:;" onclick="about()">关于项目</a>
    </li>


    <li class="layui-nav-item" lay-unselect="">
        <a href="javascript:;">{:session('z_name')}</a>
        <dl class="layui-nav-child" style="z-index: 9999;">
            <dd><a onclick="xiu()" href="javascript:;">修改密码</a></dd>
            <dd><a href="out.html">退了</a></dd>
        </dl>
    </li>
</ul>
<div class="layui-fluid" style="margin-top: 15px;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">项目 列表</div>
                <div class="layui-card-body">
                    <table class="layui-hide" id="test-table-toolbar" lay-filter="test-table-toolbar"></table>
                    <div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-10" lay-id="test-table-toolbar" style=" ">
                        <div class="layui-table-tool">
                            <div class="layui-table-tool-temp">
                                <div class="layui-btn-container">
                                    <button onclick="jia()" class="layui-btn layui-btn-sm" lay-event="getCheckData">
                                        <i class="layui-icon layui-icon-addition"></i>
                                        添加项目</button>
                                </div>
                            </div>
                        </div>
                        <div class="layui-table-box">
                            <div class="layui-table-header">
                                <table cellspacing="0" cellpadding="0" border="0" class="layui-table" style="width: 100%;">
                                    <thead>
                                    <tr>
                                        <th class=" layui-unselect">
                                            <div class="layui-table-cell"><span>ID</span></div>
                                        </th>
                                        <th class="layui-unselect">
                                            <div class="layui-table-cell"><span>项目名称</span></div>
                                        </th>
                                        <th style="width: 50%">
                                            <div class="layui-table-cell"><span>项目说明</span></div>
                                        </th>
                                        <th class="layui-unselect">
                                            <div class="layui-table-cell"><span>创建时间</span></div>
                                        </th>
                                        <th class="layui-unselect">
                                            <div class="layui-table-cell"><span>修改时间</span></div>
                                        </th>
                                        <th class="layui-unselect">
                                            <div class="layui-table-cell "><span>编辑</span></div>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="item" id="data"}
                                    <tr class="">
                                        <td><div class="layui-table-cell">{$data.id}</div></td>
                                        <td><div class="layui-table-cell">{$data.name}</div></td>
                                        <td><div class="layui-table-cell">{$data.desc|default="没有填写"}</div></td>
                                        <td><div class="layui-table-cell">{$data.create_time|date='Y-m-d H:i'}</div></td>
                                        <td><div class="layui-table-cell">{$data.update_time|date='Y-m-d H:i'}</div></td>
                                        <td class="layui-table-col-special">
                                            <div class="layui-table-cell">
                                                <a onclick="edit('{$data.id}')" class="layui-btn layui-btn-xs">编辑</a>
                                                <a onclick="del('{$data.id}')" class="layui-btn layui-btn-danger layui-btn-xs">删除</a>
                                            </div>
                                        </td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="layui-table-page" style="padding: 4px 10px">
                           {$item|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/index/layui.js"></script>

<script>
    layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });

    function jia(){
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            var index = layer.open({
                type: 2,
                title: '添加项目',
                shadeClose: true,
                shade: 0.8,
                area: ['800px', '400px'],
                content: 'add.html' //iframe的url
            });

        });
    }
    function edit(id){
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            var index=layer.open({
                type: 2,
                title: '编辑项目',
                shadeClose: true,
                shade: 0.8,
                area: ['800px', '400px'],
                content: 'edit.html?id='+id //iframe的url
            });

        });

    }
    function del(id){
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            layer.confirm('确认要删除吗？',function(index){
                $.post(
                "{:url('ajax')}",
                {
                    type:'del',
                    id:id
                },
                function(data,status){
                    if(data==1){
                        location.reload();
                        layer.msg('已删除!',{icon:1,time:1000});
                    }else{
                        layer.msg('删除失败!',{icon:5,time:1000});
                    }
                });
            });
        });
    }
    function xiu(){
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            var index = layer.open({
                type: 2,
                title: '添加项目',
                shadeClose: true,
                shade: 0.8,
                area: ['500px', '200px'],
                content: 'xiu.html' //iframe的url
            });

        });
    }
    function about() {
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            layer.alert('这个是我开发的一个简单的bug管理系统，我的邮箱，lizhilimaster@163.com。你可以访问我的博客：https://blog.csdn.net/weixin_42249565。我的github： https://github.com/lizhilicctv 。码云仓库：https://gitee.com/lizhiliwo/ ')

        });
    }
</script>
</body>

</html>